<template>
  <div id="header">
    <a href="/" id="logo">
      <span>HopeMa</span>
    </a>
    <ul id="nav">
      <li><a href="/ai">人工智能学习</a></li>
      <li><a href="/frontend">前端学习</a></li>
      <li><a href="/backend">后端学习</a></li>
      <li><a href="/soft">软件学习</a></li>
      <li><a href="/photo">摄影学习</a></li>
      <li><a href="/literature">文学学习</a></li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'nav',
  data () {
    return {
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
  #header{
    position: fixed;
    width: 100%;
    top: 0;
    box-shadow:0 0 1px rgba(0,0,0,0.25);
    transition:background-color 0.3s ease-in-out;
    background-color: #fff;
    padding: 10px 60px;
    text-align: left;
    #logo{
      display: inline-block;
      font-size: 1.5em;
      line-height:40px;
      color: #2c3e50;
      font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
      font-weight: 500;
    }
    #nav{
      position: fixed;
      list-style-type: none;
      margin: 0;
      padding: 0;
      /*position: absolute;*/
      right: 60px;
      top: 10px;
      height: 40px;
      line-height: 40px;
      li{
        display: inline-block;
        position: relative;
        margin: 0 0.6em;
        /*display: list-item;*/
        text-align: -webkit-match-parent;
      }
      a {
        color: #aaaaaa;
        text-decoration: none;
        line-height:normal;
      }

      a:hover {
        color: #000;
      }

      li a {
        display: block;
        /*font-size: 20px;*/
        text-align: center;
        /*padding: 10px 15px;*/
      }

      li a:hover {
        transform: rotate(5deg) scale(1.1);
      }

      li a:hover:before, li a:hover:after{
        transition: all 0.3s ease;
        opacity: 1;
        width: 10px;
      }

      li a:before, li a:after {
        opacity: 0;
        border-top: 1px solid #000;
        content: '';
        display: block;
        position: relative;
        z-index: -1;
        margin: auto;
        width: 0px;
      }

      li a:before {
        top: 0px;
        transform: rotate(120deg) translateY(-50%) translateX(-50%);
      }

      li a:after {
        top: 0px;
        transform: rotate(-60deg) translateY(-50%) translateX(-50%);
      }
    }
  }
</style>
